package org.apache.ocean.util;

import java.util.Comparator;
import java.util.TreeMap;

public class CaseInsensitiveStringMap<V> extends TreeMap<String, V> {
	
	public static void main(String[] args) {
		CaseInsensitiveStringMap map = new CaseInsensitiveStringMap();
		map.put("hello", new Object());
		map.put("hello", new Object());
		map.put("hello", new Object());
		map.get("hello");
	}
	
	public CaseInsensitiveStringMap() {
		super(new CaseInsensitiveComparator());
	}

	public static class CaseInsensitiveComparator implements Comparator<String> {
		public int compare(String o1, String o2) { 
			return o1.toLowerCase().compareTo(o2.toLowerCase());
		}
	}
}
